\appendix
\section{Partial derivatives of $g(S,N)$}
\label{app:A}
The fist partial derivatives are given by 
\begin{equation}
\frac{\partial g}{\partial S}=\frac{\alpha_1(\alpha_3+N)^2}{[(\bar{S}
-S)(\alpha_3+N)-\alpha_2]^2}>0  \label{eq:PartialgPartialS}
\end{equation}
and 
\begin{equation}
\frac{\partial g}{\partial N}=-\frac{\alpha_1\alpha_2}{[(\bar{S}
-S)(\alpha_3+N)-\alpha_2]^2}<0  \label{eq:PartialgPartialN}
\end{equation}
so that increases in $S$ increase marginal cost, while improved technology reduces the costs of providing fossil fuel energy. The second order partial derivatives with respect to $S$ and $N$ are given by
\begin{equation}
\frac{\partial^2 g}{\partial S^2}=\frac{2\alpha_1(\alpha_3+N)^3}{[(\bar{S}
-S)(\alpha_3+N)-\alpha_2]^3}>0  \label{eq:Partial2gPartialS2}
\end{equation}
and 
\begin{equation}
\frac{\partial^2 g}{\partial N^2}=\frac{2\alpha_1\alpha_2(\bar{S}-S)}{[(\bar{
S}-S)(\alpha_3+N)-\alpha_2]^3}>0  \label{eq:Partial2gPartialN2}
\end{equation}
In particular, this function implies that cumulative exploitation $S$ increases fossil fuel energy cost at an increasing rate, while investment in fossil fuel technology decreases costs at a decreasing rate. In fact, we can conclude from \eqref{eq:PartialgPartialN} that $\partial g/\partial N\rightarrow 0$ as $N\rightarrow\infty$. The latter fact should imply that eventually it becomes uneconomic to invest further in reducing the costs of fossil fuel energy. Thus, fossil fuel resources will likely be abandoned long before all known deposits are exhausted as rising costs make renewable energy technologies more attractive.

Finally, the cross second partial derivative will be given by 
\begin{equation}
\frac{\partial^2 g}{\partial N\partial S}=-\frac{2\alpha_1\alpha_2(
\alpha_3+N)}{[(\bar{S}-S)(\alpha_3+N)-\alpha_2]^3}<0
\label{eq:Partial2gPartialSN}
\end{equation}
Hence, investment in fossil fuel technology delays the increase in costs of fossil fuel energy accompanying increased exploitation.

\section{The Numerical Solution Procedure}

In the numerical analysis, we can solve the model moving either backwards or forwards through time, but in practice we found it easier to solve backwards. In the backwards solution, we know the values of the co-state variables at the various transition points. The known initial values $S(0)=N(0)=0$, $k(0)=k_{0}>0$ of the state variables at $t=0$  become targets. We have three free variables to set in order to hit these three target values.

Specifically, if we guess values for the transition time $T_2$ and the value of the capital stock at that time $k(T_2) $, the values of the constant $ \bar{K}$ and hence $\lambda(T_2)$ are also determined. We also know that at $ T_2$ we must have  $\eta(T_2)=0$ and $p=(\Gamma_{1}+H)^{-\alpha }=\Gamma _{2} $, which will determine the value of $H$ at $T_{2}$, namely $H=\Gamma_{2}^{-1/\alpha }-\Gamma _{1}$. The differential equations \eqref{eq:Hdotjpos}, \eqref{eq:lamdotreg2}, \eqref{eq:etadotreg2} and \eqref{eq:budgetreg2} are then solved backward until $T_1$, when $H=0$. The values of $k$ and $\lambda$ at $T_1$ then provide initial conditions for the differential equations \eqref{eq:Reg1_keq} and \eqref{eq:Reg1_lameq} in the fossil fuel regime. Using \eqref{eq:BstopNrgP} and \eqref{eq:NrgP_fossregime}, the fact that $\sigma(T_1)=0$, and the requirement that the shadow price of energy has to be continuous across the region boundaries we conclude that
\begin{equation}
\Gamma _{1}^{-\alpha }-\frac{\eta}{\lambda}=\frac{\epsilon}{\lambda}= g(S,N)
\label{eq:T_1NrgP}
\end{equation}
For the values of $\eta(T_1)$ and $\lambda(T_1)$ obtained from the backward solution in the renewable regime, and the exogenously specified $ \Gamma_1^{-\alpha}$, \eqref{eq:T_1NrgP} would then determine the value of the mining cost $g(S(T_1),N(T_1))$ at $T_1$. Thus, $N(T_1)$ will be determined once we guess the value of $S(T_1)$. Finally, the requirements that $\sigma(T_1)=0=\nu(T_1)$ will provide the remaining initial conditions for the five differential equations \eqref{eq:nudot}, \eqref{eq:Reg1_keq}, \eqref{eq:Reg1_Seq}, \eqref{eq:Reg1_sigeq} and \eqref{eq:Reg1_lameq}. The initial fossil fuel regime with $n>0$ then starts at $T_0$ when $\nu=\lambda$. For all $t\le T_0$, we then have $k, S, N, \sigma$ and $\lambda$ given by the solutions to the differential equations \eqref{eq:Reg1_keq}--\eqref{eq:Reg1_lameq}.


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
